#include "customer/customer.h"
#include <cpprest/details/basic_types.h>
#include <cpprest/uri.h>
#include <cpprest/http_listener.h>

using namespace ::web;
using namespace ::web::http;
using namespace ::utility::string_t;

auto responder::respond(const http_request &requestm status_code status, const json::value &response) ->void {
  json::value resp;
  resp[string_t("status")] = json::value::number(status); 
  resp[string_t("response")] = response;
  request.reply(status, resp);
}

auto responder::prepare_response(const std::string &name) -> std::pair<status_code, json::value> {
  return {status_code::OK, json::value::string(string_t("Hello, ") + name + "!")};
}
